<?php

namespace common\entities\myhtsq;

use Yii;

/**
 * This is the model class for table "myscrm_contract_application".
 *
 * @property string $contract_application_id
 * @property string $contract_id
 * @property string $application_id
 * @property string $price
 * @property string $unit
 * @property integer $authorization_type
 * @property integer $authorization_numeric
 * @property integer $rent_period
 * @property string $amount
 * @property string $created_on
 * @property string $created_by
 * @property string $modified_on
 * @property string $modified_by
 */
class ContractApplicationEntity extends \common\entities\ConfigEntity
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'myscrm_contract_application';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['contract_application_id'], 'required'],
            [['price', 'amount','balance_amount','balance_rate','balance_should_amount'], 'number'],
            [['authorization_type', 'authorization_numeric', 'rent_period','balance_type'], 'integer'],
            [['created_on', 'modified_on','balance_should_amount'], 'safe'],
            [['contract_application_id', 'contract_id', 'application_id', 'created_by', 'modified_by'], 'string', 'max' => 36],
            [['unit'], 'string', 'max' => 30]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'contract_application_id' => '合同产品ID',
            'contract_id' => '合同ID',
            'application_id' => '产品ID',
            'price' => '标准单价',
            'unit' => '单位',
            'authorization_type' => '授权类型',
            'authorization_numeric' => '授权数',
            'rent_period' => '租用周期（单位：月）',
            'amount' => '标准总额',
            'balance_rate' =>'结算比率',
            'balance_type' =>'结算类型',
            'balance_amount' =>'结算金额',
            'balance_should_amount' => '应结算金额',
            'created_on' => '创建时间',
            'created_by' => '创建人',
            'modified_on' => '修改时间',
            'modified_by' => '修改人',
        ];
    }
}
